import React, { PropTypes } from "react"

require('./UnmannedCarOrder.less')


const statusName = ['待送达', '已完成', '已取消'];

class UnmannedCarOrder extends React.Component {

    constructor(props) {
        super(props)
    }

    render() {
        let data = this.props.dataSource
        return (
            <div className="unmanned-card" onClick={this.props.onClick}>
                <div className="unmanned-card__status">
                    <span>{statusName[data.status - 1]}</span>
                    <span>{[0, 5].includes(data.vehicleStatus) ? '未存入无人车' : data.openCode}</span>
                </div>
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                    <div className="unmanned-card__content">
                        <div className="unmanned-card__content_number">
                            <div className="label label-colon">订单编号</div>
                            <div className="span">
                                {data.orderId}
                            </div>
                        </div>
                        <div className="unmanned-card__content_number">
                            <div className="label label-colon">{data.status === 1 ? '配送时间' : data.status === 2 ? '送达时间' : '取消时间'}</div>
                            <div className="span">
                                {data.status === 1 ? data.deliverTime : data.finishTime}
                            </div>
                        </div>
                        <div className="unmanned-card__content_number">
                            <div className="label label-colon">&nbsp;&nbsp;&nbsp;联系人</div>
                            <div className="span">
                                <a href={`tel:${data.contactPhone}`} className=" lux-cffa600">{data.contactPhone}</a>
                            </div>
                        </div>

                    </div>
                    <i className="jiantou"></i>
                </div>
            </div>
        )
    }
}

module.exports = UnmannedCarOrder